<template>
<div class="view-Example02">
	Example02
	<el-button @click="add1">{{count}}</el-button>
	<el-button @click="add2">{{loginUserNum}}</el-button>
	<el-button @click="add1">双点击事件</el-button>
</div>
</template>
<script>
import { ref, computed, getCurrentInstance } from 'vue'
import { useStore } from 'vuex'

export default {
	name: 'Example02',
	props: {
		msg: String
	},
	setup (props, context) {
		const store = useStore();
		const { proxy } = getCurrentInstance();
		const loginUserNum = computed(() => store.state.loginUserNum);
		console.log('globaltest01', proxy.globaltest01);
		const count = ref(0);
		const add1 = () => count.value++;
		const add2 = () => {
			store.dispatch('addUserNum');
		};
		console.log(111111111111);
		console.log(props);
		console.log(context);
		return {
			count,
			loginUserNum,
			add1,
			add2,
		}
	},
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
</style>